const { lawyerAPI } = require('../../../utils/api');

Page({
  data: {
    lawersList: [],
  },
  onLoad: function() {
    this.loadLawersList();
  },
  loadLawersList: function() {
    lawyerAPI.list({ pageNum: 1, pageSize: 4 }).then(res => {
      this.setData({ lawersList: res.data.list });
    });
  },
  toDetail: function(e) {
    const id = e.currentTarget.dataset.id;
    wx.navigateTo({ url: '/pages/team/teamDetail/teamDetail?id=' + id });
  },
  toAll: function() {
    wx.navigateTo({ url: '/pages/team/teamList/teamList?showRecommend=1' });
  },
  openCall: function(e) {
    const phone = e.currentTarget.dataset.index;
    if (phone) {
      wx.makePhoneCall({ phoneNumber: phone });
    } else {
      wx.showToast({ title: '暂无电话', icon: 'none' });
    }
  }
}); 